package com.org.gsc.zuixindemo;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import moe.feng.common.stepperview.VerticalStepperItemView;
/**
 * Created by qundui on 2017/10/23.
 */
public class StepViewPage extends AppCompatActivity {
    private VerticalStepperItemView mSteppers[] = new VerticalStepperItemView[4];
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.stepviewtest);
        mSteppers[0]= (VerticalStepperItemView) findViewById(R.id.stepper_0);
        mSteppers[1]= (VerticalStepperItemView) findViewById(R.id.stepper_1);
        mSteppers[2]= (VerticalStepperItemView) findViewById(R.id.stepper_2);
        mSteppers[3]= (VerticalStepperItemView) findViewById(R.id.stepper_3);
        VerticalStepperItemView.bindSteppers(mSteppers);
        Button button0 = (Button) findViewById(R.id.button_next_0);
        button0.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mSteppers[0].nextStep();
            }
        });

        Button button1 = (Button) findViewById(R.id.button_next_1);
        button1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mSteppers[1].nextStep();
            }
        });
        Button button2 = (Button) findViewById(R.id.button_next_2);
        button2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mSteppers[2].nextStep();
            }
        });
        Button button3 = (Button) findViewById(R.id.button_next_3);
        button3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(StepViewPage.this,"ok",Toast.LENGTH_LONG).show();
            }
        });
        Button cancle1= (Button) findViewById(R.id.cancle1);
        cancle1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mSteppers[1].prevStep();
            }
        });
        Button cancle2= (Button) findViewById(R.id.cancle2);
        cancle2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mSteppers[2].prevStep();
            }
        });
        Button cancle3= (Button) findViewById(R.id.cancle3);
        cancle3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mSteppers[3].prevStep();
            }
        });
    }
}
